﻿using Microsoft.Xna.Framework.Input;

namespace Brouteforce.oldapi {
    class KeyWatcher{
        private Keys key;
        private bool down = false;

        public KeyWatcher(Keys key){
            this.key = key;
        }

        public bool Pressed{
            get{
                KeyboardState kb = Keyboard.GetState();
                if (kb.IsKeyDown(key) && !down){
                    down = true;
                    return true;
                } else if (kb.IsKeyUp(key)) { //KEY UP
                    down = false;
                }

                return false;
            }
        }
    }
}
